﻿using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;

namespace TwitterFlow
{
	public partial class CombineFeedsToComicCouplets: Activity
	{
		public CombineFeedsToComicCouplets()
		{
			InitializeComponent();
		}


        public static DependencyProperty SecondInputProperty = System.Workflow.ComponentModel.DependencyProperty.Register("SecondInput", typeof(IList<TwitterStatus>), typeof(CombineFeedsToComicCouplets));

        [Description("This is the description which appears in the Property Browser")]
        [Category("Input")]
        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        public IList<TwitterStatus> SecondInput
        {
            get
            {
                return ((IList<TwitterStatus>)(base.GetValue(CombineFeedsToComicCouplets.SecondInputProperty)));
            }
            set
            {
                base.SetValue(CombineFeedsToComicCouplets.SecondInputProperty, value);
            }
        }
        public static DependencyProperty FirstInputProperty = System.Workflow.ComponentModel.DependencyProperty.Register("FirstInput", typeof(IList<TwitterStatus>), typeof(CombineFeedsToComicCouplets));

        [Description("This is the description which appears in the Property Browser")]
        [Category("Input")]
        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        public IList<TwitterStatus> FirstInput
        {
            get
            {
                return ((IList<TwitterStatus>)(base.GetValue(CombineFeedsToComicCouplets.FirstInputProperty)));
            }
            set
            {
                base.SetValue(CombineFeedsToComicCouplets.FirstInputProperty, value);
            }
        }
        public static DependencyProperty CoupletsProperty = System.Workflow.ComponentModel.DependencyProperty.Register("Couplets", typeof(IList<ComicCouplet>), typeof(CombineFeedsToComicCouplets));

        [Description("This is the description which appears in the Property Browser")]
        [Category("Output")]
        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        public IList<ComicCouplet> Couplets
        {
            get
            {
                return ((IList<ComicCouplet>)(base.GetValue(CombineFeedsToComicCouplets.CoupletsProperty)));
            }
            set
            {
                base.SetValue(CombineFeedsToComicCouplets.CoupletsProperty, value);
            }
        }


        protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
        {
            List<ComicCouplet> theList = new List<ComicCouplet>();
            for (int i = 0; i < FirstInput.Count; i++)
            {
                ComicCouplet cc = new ComicCouplet(FirstInput[i], SecondInput[i]);
                theList.Add(cc);

            }
            Couplets = theList;
            return ActivityExecutionStatus.Closed;
        }

	}
}
